<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/13
 * Time: 19:32
 */

namespace app\api\model;



class Wxsetting extends BaseModel
{
    //小程序配置的缓存处理
    public static function getWxCache(){
        //查询缓存
        $cache = \think\Cache::get('wxconfig');
        //缓存不存在
        if(!$cache){
            //重新查询存储到缓存
            $result = self::find();
            $result = $result->toArray();
            \think\Cache::set('wxconfig',$result);
        }
        return \think\Cache::get('wxconfig');
    }
}